package com.example.dqdq.lzyim_asm_tvapp.utils;

import android.app.Activity;
import android.util.Log;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by DQDQ on 2016/10/11.
 */

public class ActivityCollector {


    public static List<Activity> activities = new ArrayList<Activity>();

    public static void addActivity(Activity activity) {
        activities.add(activity);
    }

    public static void removeActivity(Activity activity) {
        activities.remove(activity);
    }

    public static void finishAll(Activity ac) {
        for (Activity activity : activities) {
            if (!activity.isFinishing()) {
                if (ac!=activity)
                {
                  activity.finish();
                }
            }
        }
    }


}
